package com.ruihu.admin.module.business.tasknode.domain.vo;

import com.ruihu.admin.module.business.tasknode.domain.entity.NodeDefectRelationEntity;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;

/**
 *  [  ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c) 瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date  2022-09-22 20:56:54
 * @since JDK1.8
 */

@Data
public class NodeDefectRelationVO {
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("defect_type_id")
    private Long defectTypeId;

    @ApiModelProperty("task_node_id")
    private Long taskNodeId;

    @ApiModelProperty("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;


    public static NodeDefectRelationVO convertToNodeDefectRelationVO(NodeDefectRelationEntity entity) {
        if (entity == null){
            return null;
        }
        NodeDefectRelationVO vo = new NodeDefectRelationVO();
        vo.setId(entity.getId());
         vo.setDefectTypeId(entity.getDefectTypeId());
         vo.setTaskNodeId(entity.getTaskNodeId());
         vo.setCreateTime(entity.getCreateTime());
         vo.setUpdateTime(entity.getUpdateTime());
         return vo;
    }
}
